/*
package com.weiyan.fegin.impl;

import com.weiyan.domian.Product;
import com.weiyan.fegin.ProductServer;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

*/
/**
 * @author misterWei
 * @create 2020年02月25号:22点44分
 * @mailbox mynameisweiyan@gmail.com
 * Feign远程调用所能打印错误信息的降级方式
 *//*

@Component
@Slf4j
public class ProductServerFallBackFactory implements FallbackFactory<ProductServer> {
    @Override
    public ProductServer create(Throwable throwable) {
        return new ProductServer() {
            @Override
            public Product findByPid(Integer pid) {
                log.error("{}",throwable);
                return null;
            }

            @Override
            public void decrement(Integer pid) {
               throw new RuntimeException(throwable.getMessage());
            }
        };
    }
}
*/
